home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / softwareupdate / system / amigados / introduction / example1.c < prev    next >
C/C++ Source or Header  |  1996-10-10  |  2KB  |  68 lines

  1. /***********************************************************/
  2. /*                                                         */
  3. /* Amiga C Encyclopedia (ACE)           Amiga C Club (ACC) */
  4. /* --------------------------           ------------------ */
  5. /*                                                         */
  6. /* Manual:  AmigaDOS                    Amiga C Club       */
  7. /* Chapter: Introduction                Tulevagen 22       */
  8. /* File:    Example1.c                  181 41  LIDINGO    */
  9. /* Author:  Anders Bjerin               SWEDEN             */
  10. /* Date:    93-09-24                                       */
  11. /* Version: 1.1                                            */
  12. /*                                                         */
  13. /*   Copyright 1993, Anders Bjerin - Amiga C Club (ACC)    */
  14. /*                                                         */
  15. /* Registered members may use this program freely in their */
  16. /*     own commercial/noncommercial programs/articles.     */
  17. /*                                                         */
  18. /***********************************************************/
  19.  
  20. /* This short example examines the Dos library and */
  21. /* prints the current version and revision number. */
  22.  
  23.  
  24.  
  25. /* Include the dos library definitions: */
  26. #include <dos/dosextens.h>
  27.  
  28. /* Now we include the necessary function prototype files: */
  29. #include <stdio.h>                 /* Std functions [printf()]  */
  30. #include <stdlib.h>                /* Std functions [exit()]    */
  31.  
  32.  
  33.  
  34. /* Set name and version number: */
  35. UBYTE *version = "$VER: AmigaDOS/AmigaDOS/Example1 1.1";
  36.  
  37.  
  38.  
  39. /* Declare an external global library pointer to the Dos library:  */
  40. /* (Since the Dos library is always open we do not have to open it */
  41. /* ourself. We simply declare the pointer as an external pointer   */
  42. /* and it will automatically be initialized for us. Very handy.)   */
  43. extern struct DosLibrary *DOSBase;
  44.  
  45.  
  46.  
  47. /* Declare our own function(s): */
  48. int main( int argc, char *argv[] );
  49.  
  50. /* The main function: */
  51.  
  52. int main( int argc, char *argv[] )
  53. {
  54.   /* We will now examine the Dos library: */
  55.   printf( "Dos library:\n" );
  56.   
  57.   /* Print version (major changes): */
  58.   printf( "  Version: %4d\n", DOSBase->dl_lib.lib_Version );
  59.  
  60.   /* Print revision (minor changes):  */
  61.   printf( "  Revision: %3d\n", DOSBase->dl_lib.lib_Revision );
  62.  
  63.   /* The End (0 = success) */
  64.   exit( 0 );
  65. }
  66.  
  67.  
  68.